import 'package:flutter/material.dart';
import 'package:hrcapp/app_routes.dart';
import 'package:hrcapp/screens/asset_market_screen.dart';
import 'package:hrcapp/screens/wallet_screen.dart';
import 'package:hrcapp/screens/profile_screen.dart';
import 'package:hrcapp/screens/trade_screen.dart';
import 'package:hrcapp/screens/hrc_foundation_screen.dart';

class HomeScreen extends StatefulWidget {
  const HomeScreen({super.key});

  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  int _currentIndex = 0;

  final List<Widget> _pages = [
    const AssetMarketScreen(),
    const TradeScreen(),
    const WalletScreen(),
    const ProfileScreen(),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _pages[_currentIndex],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _currentIndex,
        onTap: (index) {
          setState(() {
            _currentIndex = index;
          });
        },
        items: const [
          BottomNavigationBarItem(
            icon: Icon(Icons.shopping_bag),
            label: '首页',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.swap_vert),
            label: '交易',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.wallet),
            label: '资产',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.person),
            label: '我的',
          ),
        ],
        selectedItemColor: const Color(0xFF1890FF),
        unselectedItemColor: Colors.grey,
        backgroundColor: Colors.white,
        elevation: 8,
        showSelectedLabels: true,
        showUnselectedLabels: true,
        type: BottomNavigationBarType.fixed,
        selectedFontSize: 14,
        unselectedFontSize: 14,
      ),
    );
  }
}